From 1fc9a9892bc5f96325f453355e5b79f3c77c61ac Mon Sep 17 00:00:00 2001 From: "kaf24@freefall.cl.cam.ac.uk" Date: Thu, 9 Sep 2004 23:33:20 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.145 (4140e840rdAgNzGs4H22eopT-ononA) Fix Xen for recent GCC. --- xen/include/acpi/platform/acgcc.h | 2 +- xen/include/xen/compiler.h | 6 ++++++ xen/include/xen/init.h | 12 ++++++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/xen/include/acpi/platform/acgcc.h b/xen/include/acpi/platform/acgcc.h index 61abbc378c..ac15b08460 100644 --- a/xen/include/acpi/platform/acgcc.h +++ b/xen/include/acpi/platform/acgcc.h @@ -54,6 +54,6 @@ * to to tell the compiler warning in a per-variable manner that a variable * is unused. */ -#define ACPI_UNUSED_VAR __attribute__ ((unused)) +#define ACPI_UNUSED_VAR __attribute_used__ #endif /* __ACGCC_H__ */ diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h index 05205c74bc..f0c5fbf17a 100644 --- a/xen/include/xen/compiler.h +++ b/xen/include/xen/compiler.h @@ -13,4 +13,10 @@ #define likely(x) __builtin_expect((x),1) #define unlikely(x) __builtin_expect((x),0) +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) +#define __attribute_used__ __attribute__((__used__)) +#else +#define __attribute_used__ __attribute__((__unused__)) +#endif + #endif /* __LINUX_COMPILER_H */ diff --git a/xen/include/xen/init.h b/xen/include/xen/init.h index 4b0589befd..7e66567a5b 100644 --- a/xen/include/xen/init.h +++ b/xen/include/xen/init.h @@ -67,7 +67,7 @@ extern struct kernel_param __setup_start, __setup_end; #define __setup(str, fn) \ static char __setup_str_##fn[] __initdata = str; \ - static struct kernel_param __setup_##fn __attribute__((unused)) __initsetup = { __setup_str_##fn, fn } + static struct kernel_param __setup_##fn __attribute_used__ __initsetup = { __setup_str_##fn, fn } #endif /* __ASSEMBLY__ */ @@ -76,12 +76,12 @@ extern struct kernel_param __setup_start, __setup_end; * or exit time. */ #define __init __attribute__ ((__section__ (".text.init"))) -#define __exit __attribute__ ((unused, __section__(".text.exit"))) +#define __exit __attribute_used__ __attribute__ ((__section__(".text.exit"))) #define __initdata __attribute__ ((__section__ (".data.init"))) -#define __exitdata __attribute__ ((unused, __section__ (".data.exit"))) -#define __initsetup __attribute__ ((unused,__section__ (".setup.init"))) -#define __init_call __attribute__ ((unused,__section__ (".initcall.init"))) -#define __exit_call __attribute__ ((unused,__section__ (".exitcall.exit"))) +#define __exitdata __attribute_used__ __attribute__ ((__section__ (".data.exit"))) +#define __initsetup __attribute_used__ __attribute__ ((__section__ (".setup.init"))) +#define __init_call __attribute_used__ __attribute__ ((__section__ (".initcall.init"))) +#define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit"))) /* For assembly routines */ #define __INIT .section ".text.init","ax" -- 2.30.2